package basic;

public class basic1716 {
        public int totalMoney(int n) {
            int moneysum=0;
            int initial=0;
            for (int i = 1; i <=n; i++) {
                if (i%7==1){
                    initial=i/7+1;
                    moneysum=moneysum+initial;
                    continue;
                }
                initial+=1;
                moneysum=moneysum+initial;

            }
            return moneysum;
        }

    public static void main(String[] args) {
        basic1716 basic1716 = new basic1716();
        int i = basic1716.totalMoney(20);
        System.out.println(i);
    }

}
